Skip to content

make socket component example work #624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 13, 2025

Conversation

jprendes
Copy link
Contributor

This PR removes the Clone and PartialEq requirement from variant and record wit types.
This change makes the hyperlight-wasm-sockets-example example work.

@jprendes
Copy link
Contributor Author

It's worth noting that the branch that hyperlight-wasm was using until now didn't derive those traits either:
https://github.com/hyperlight-dev/hyperlight/blob/hyperlight-wasm-macro/src/hyperlight_component_util/src/rtypes.rs#L371-L384

@jprendes jprendes force-pushed the fix-socket branch 2 times, most recently from 9cf240f to 0871eaf Compare June 13, 2025 21:37
@jsturtevant
Copy link
Contributor

It's worth noting that the branch that hyperlight-wasm was using until now didn't derive those traits either: https://github.com/hyperlight-dev/hyperlight/blob/hyperlight-wasm-macro/src/hyperlight_component_util/src/rtypes.rs#L371-L384

This seems reasonable to me. We may want to look at how we handle testing variants with resources in them in the future to cover our bases. This is the wit that generated this issue:

package wasi:[email protected] {
  interface error {
    resource error;
  }
  interface poll {
    resource pollable {
      block: func();
    }
  }
  interface streams {
    use error.{error};

    resource output-stream {
      check-write: func() -> result<u64, stream-error>;
      write: func(contents: list<u8>) -> result<_, stream-error>;
      blocking-write-and-flush: func(contents: list<u8>) -> result<_, stream-error>;
      blocking-flush: func() -> result<_, stream-error>;
    }

    variant stream-error {
      last-operation-failed(error),
      closed,
    }

    resource input-stream;
  }
}

@jsturtevant jsturtevant enabled auto-merge (squash) June 13, 2025 23:44
@jsturtevant jsturtevant merged commit 5208cfe into hyperlight-dev:main Jun 13, 2025
60 of 86 checks passed
ludfjig pushed a commit to ludfjig/hyperlight that referenced this pull request Jun 14, 2025
* make socket component example work

Signed-off-by: Jorge Prendes <[email protected]>

* bump Cargo.lock for witguest

Signed-off-by: Jorge Prendes <[email protected]>

---------

Signed-off-by: Jorge Prendes <[email protected]>
ludfjig added a commit that referenced this pull request Jun 14, 2025
* Update Crate descriptions for guest crates (#590)

Add verification of crate versions for new crates to Crate Publish job

Amend the order of crate publishing to account for dependencies

Signed-off-by: Simon Davies <[email protected]>

* Make cargo publish only publish unreleased crates (#623)

Signed-off-by: Ludvig Liljenberg <[email protected]>

* make socket component example work (#624)

* make socket component example work

Signed-off-by: Jorge Prendes <[email protected]>

* bump Cargo.lock for witguest

Signed-off-by: Jorge Prendes <[email protected]>

---------

Signed-off-by: Jorge Prendes <[email protected]>

---------

Signed-off-by: Simon Davies <[email protected]>
Signed-off-by: Ludvig Liljenberg <[email protected]>
Signed-off-by: Jorge Prendes <[email protected]>
Co-authored-by: Simon Davies <[email protected]>
Co-authored-by: Ludvig Liljenberg <[email protected]>
Co-authored-by: Jorge Prendes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bugfix For PRs that fix bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants